package com.zipking.cloud.springbootmybatis.controller;

import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.extension.api.R;
import com.github.pagehelper.PageInfo;
import com.google.common.collect.Maps;
import com.zipking.cloud.springbootmybatis.config.ApiCoreFactory;
import com.zipking.cloud.springbootmybatis.persistance.entity.TMenu;
import com.zipking.cloud.springbootmybatis.persistance.service.IMsgLogExtService;
import com.zipking.cloud.springbootmybatis.persistance.service.ITMenuService;
import com.zipking.cloud.springbootmybatis.prop.DbConf;
import com.zipking.cloud.springbootmybatis.prop.DbProperties;
import com.zipking.cloud.springbootmybatis.service.BaseService;
import com.zipking.cloud.springbootmybatis.util.PageUtils;
import com.zipking.cloud.springbootmybatis.util.PagerUtilsExt;
import com.zipking.cloud.springbootmybatis.util.PaginationHelper;
import com.zipking.cloud.springbootmybatis.vo.MenuVo;
import org.apache.commons.lang3.StringUtils;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.connection.BitFieldSubCommands;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Callable;
import java.util.concurrent.CompletableFuture;

@RestController
@RequestMapping(value = "/menu")
public class MenuController {
    @Autowired
     private ITMenuService menuService;



    @RequestMapping(value = "/getMenuByPage")
    public Object getMenuByPage(Integer  pageSize,Integer currentPage) {
        PaginationHelper<MenuVo> tMenuList=menuService.getMenuByPage(pageSize,currentPage);
        return R.ok(tMenuList);
    }

    @RequestMapping(value = "/getMenuByPage2")
    public Object getMenuByPage2(Integer  pageSize,Integer currentPage) {
        PageInfo<TMenu> tMenuList=menuService.getMenuByPage2(pageSize,currentPage);
        return R.ok(tMenuList);
    }

}
